<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图片</title>
    <style>
        /* 若用混合单位，第一个值一定是x轴坐标，第二个值一定是y轴坐标 */
        .div1 {
            width: 300px;
            height: 300px;
            background-color: black;
            background-image: url(images/王者logo.png);
            background-repeat: no-repeat;
            background-position: 20px center;
            /* 两者交换效果不一样 */
        }

        .div2 {
            width: 300px;
            height: 300px;
            background-color: rgb(181, 7, 7);
            background-image: url(images/王者logo.png);
            background-repeat: no-repeat;
            background-position: center 20px;
            /* 两者交换效果不一样 */
        }
    </style>
</head>

<body>
    <div class="div1">
    </div>
    <div class="div2"></div>
</body>

</html>